
import java.io.IOException;
import net.bot.server.CommandRequestHandler;
import net.bot.server.WebServer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author chipn03877
 */
public class Main {

    public static void main(String[] args) {
        String docRoot = "C:/Users/chipn03877/Documents/NetBeansProjects/HttpBot/web";
        int port = 1234;
        if (args != null && args.length >= 2) {
        } else {
            //TODO: Accept parameters from args
        }

        try {
            WebServer webServer = new WebServer(port, docRoot);
            webServer.start(5);
            webServer.getRequestHandlerRegistry().put("/command/.*", new CommandRequestHandler());
        } catch (IOException ex) {
            System.out.println("#INFO: Server can not start!");
            ex.printStackTrace();
        }
    }
}
